package com.team11.server.service.admin;


import com.team11.server.mapper.Admin_Update_C_Mapper;
import com.team11.server.pojo.C_T_S_information;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class Admin_Update_C_Service {
    @Autowired
    private Admin_Update_C_Mapper admin_update_c_mapper;
    public String Sel_haveC(HashMap<String,Object> map){
        Integer t=admin_update_c_mapper.Sel_haveC(map);
        if(t>0){
            return "班级已存在";
        }
        else
            return "1";
    }
    public String Sel_Have_TinC(HashMap<String,Object> map){
        String tN= (String) map.get("tName");
        String[] tArray=tN.split("-");

        String tNumber=tArray[0];
        String tName=tArray[1];
        map.put("tJobNumber",tNumber);
        map.put("tName",tName);
        Integer t=admin_update_c_mapper.Sel_Have_TinC(map);
        if (t>0){
            return "1";
        }
        else
            return "教师不存在";
    }
    public String Update_C(HashMap<String,Object> map){
        Integer t=admin_update_c_mapper.Update_C(map);
        if(t>0){
            return "修改成功";
        }
        else
            return "修改失败";
    }
}
